Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

356
Visualizações
Error: Type with name "AuthorYaml" does not exists - gatsby-casper starter

I'm trying to build a gatsby website based on gatsby-casper starter but I am getting a hard to debug error related to the graphql schema. The error I get is this:

Error: Type with name "AuthorYaml" does not exists

- TypeStorage.js:44 SchemaComposer.get
[Physicc-blog]/[graphql-compose]/lib/TypeStorage.js:44:13

- TypeMapper.js:585 ThunkComposer._thunk
[Physicc-blog]/[graphql-compose]/lib/TypeMapper.js:585:34

- ThunkComposer.js:20 ThunkComposer.get ofType [as ofType]
[Physicc-blog]/[graphql-compose]/lib/ThunkComposer.js:20:34

- ThunkComposer.js:46 ThunkComposer.getType
[Physicc-blog]/[graphql-compose]/lib/ThunkComposer.js:46:17

- ListComposer.js:22 ListComposer.getType
[Physicc-blog]/[graphql-compose]/lib/ListComposer.js:22:49

- ObjectTypeComposer.js:348 ObjectTypeComposer.getFieldConfig
[Physicc-blog]/[graphql-compose]/lib/ObjectTypeComposer.js:348:18

- index.js:220 forEach
[Physicc-blog]/[gatsby]/src/schema/extensions/index.js:220:48

- Array.forEach

- index.js:215 forEach
[Physicc-blog]/[gatsby]/src/schema/extensions/index.js:215:8

- Array.forEach

- index.js:211 processFieldExtensions
[Physicc-blog]/[gatsby]/src/schema/extensions/index.js:211:32

- schema.js:226 processTypeComposer
[Physicc-blog]/[gatsby]/src/schema/schema.js:226:11

- schema.js:200 map
[Physicc-blog]/[gatsby]/src/schema/schema.js:200:7

- Array.map

- schema.js:199 updateSchemaComposer
[Physicc-blog]/[gatsby]/src/schema/schema.js:199:50

- schema.js:64 buildSchema
[Physicc-blog]/[gatsby]/src/schema/schema.js:64:3

I have used

gatsby new my-gatsby-project https://github.com/scttcper/gatsby-casper

to initialize the project. I'm unable to figure out why this error is being generated.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Well... that starter (gatsby-casper) has a reference to AuthorYaml in the gatsby-node.js at line 105:

  allAuthorYaml {
    edges {
      node {
        id
      }
    }

So if you haven't defined that node, your GraphQL query is not able to run, hence the code is breaking.

Pulling more the thread, allAuthorsYaml is a node created by gatsby-transformer-yaml, present in gatsby-config.js (line 64):

'gatsby-transformer-yaml',

And mapped in line 11 of the same gatsby-config.js file:

  mapping: {
    'MarkdownRemark.frontmatter.author': 'AuthorYaml',
  },

This means that you are creating an AuthorYaml node from the author field in your markdown frontmatter.

So, if your markdown frontmatter doesn't contain an author reference, your code will break. It can be easily fixed by setting the proper author in the markdown file, or just by removing allAuthorYaml query node from the gatsby-node.js and all the related references to them like:

  // Create author pages
  const authorTemplate = path.resolve('./src/templates/author.tsx');
  result.data.allAuthorYaml.edges.forEach(edge => {
    createPage({
      path: `/author/${_.kebabCase(edge.node.id)}/`,
      component: authorTemplate,
      context: {
        author: edge.node.id,
      },
    });
  });
};

From line 188 from gatsby-node.js file.

The same applies for authorTemplate since you won't be passing any author in the context your authorTemplate query will fail too.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda